package Hibernate.dao;

import java.util.ArrayList;
import java.util.Map;

import net.sf.json.JSONObject;

/**
 * Examiee entity. @author MyEclipse Persistence Tools
 */

public class Examiee implements java.io.Serializable {

	// Fields

	

	private String userId;
	@Override
	public String toString() {
		return "{userId:'" + userId + "', idCardNum:'" + idCardNum
				+ "', admitId:'" + admitId + "', userName:'" + userName
				+ "', userPhoto:'" + userPhoto + "', userDescribe:'"
				+ userDescribe + "', phoneNum:'" + phoneNum + "', mail:'"
				+ mail + "', subject:'" + subject + "', tempExamId:'"
				+ tempExamId + "', psd:'" + psd + "', state:'" + state
				+ "', birthday:'" + birthday + "', policy:'" + policy
				+ "', nation:'" + nation + "', eeId:'" + eeId + "', gender:'"
				+ gender + "', classroomId:'" + classroomId + "', basePath:'"
				+ basePath + "'}";
	}

	private String idCardNum;
	private String admitId;
	private String userName;
	private String userPhoto;
	private String userDescribe;
	private String phoneNum;
	private String mail;
	private String subject;
	private String tempExamId;
	private String psd;
	private Integer state;
	private String birthday;
	private String policy;
	private String nation;
	private String eeId;
	private String gender;
	private String classroomId;
	
	private String basePath = this.getClass().getClassLoader().getResource("/")
			.getPath();
	// Constructors

	/** default constructor */
	public Examiee() {
	}

	/** minimal constructor */
	public Examiee(String userId, String idCardNum, String admitId,
			String userName, String userPhoto, String userDescribe,
			String phoneNum, String mail, String subject, String psd,
			Integer state, String birthday, String policy, String nation,
			String eeId, String gender) {
		this.userId = userId;
		this.idCardNum = idCardNum;
		this.admitId = admitId;
		this.userName = userName;
		this.userPhoto = userPhoto;
		this.userDescribe = userDescribe;
		this.phoneNum = phoneNum;
		this.mail = mail;
		this.subject = subject;
		this.psd = psd;
		this.state = state;
		this.birthday = birthday;
		this.policy = policy;
		this.nation = nation;
		this.eeId = eeId;
		this.gender = gender;
	}

	/** full constructor */
	public Examiee(String userId, String idCardNum, String admitId,
			String userName, String userPhoto, String userDescribe,
			String phoneNum, String mail, String subject, String tempExamId,
			String psd, Integer state, String birthday, String policy,
			String nation, String eeId, String gender, String classroomId) {
		this.userId = userId;
		this.idCardNum = idCardNum;
		this.admitId = admitId;
		this.userName = userName;
		this.userPhoto = userPhoto;
		this.userDescribe = userDescribe;
		this.phoneNum = phoneNum;
		this.mail = mail;
		this.subject = subject;
		this.tempExamId = tempExamId;
		this.psd = psd;
		this.state = state;
		this.birthday = birthday;
		this.policy = policy;
		this.nation = nation;
		this.eeId = eeId;
		this.gender = gender;
		this.classroomId = classroomId;
	}

	// Property accessors

	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getIdCardNum() {
		return this.idCardNum;
	}

	public void setIdCardNum(String idCardNum) {
		this.idCardNum = idCardNum;
	}

	public String getAdmitId() {
		return this.admitId;
	}

	public void setAdmitId(String admitId) {
		this.admitId = admitId;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserPhoto() {
		return this.userPhoto;
	}

	public void setUserPhoto(String userPhoto) {
		this.userPhoto = userPhoto;
	}

	public String getUserDescribe() {
		return this.userDescribe;
	}

	public void setUserDescribe(String userDescribe) {
		this.userDescribe = userDescribe;
	}

	public String getPhoneNum() {
		return this.phoneNum;
	}

	public void setPhoneNum(String phoneNum) {
		this.phoneNum = phoneNum;
	}

	public String getMail() {
		return this.mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getSubject() {
		return this.subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getTempExamId() {
		return this.tempExamId;
	}

	public void setTempExamId(String tempExamId) {
		this.tempExamId = tempExamId;
	}

	public String getPsd() {
		return this.psd;
	}

	public void setPsd(String psd) {
		this.psd = psd;
	}

	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public String getBirthday() {
		return this.birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getPolicy() {
		return this.policy;
	}

	public void setPolicy(String policy) {
		this.policy = policy;
	}

	public String getNation() {
		return this.nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	public String getEeId() {
		return this.eeId;
	}

	public void setEeId(String eeId) {
		this.eeId = eeId;
	}

	public String getGender() {
		return this.gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getClassroomId() {
		return this.classroomId;
	}

	public void setClassroomId(String classroomId) {
		this.classroomId = classroomId;
	}
	
	//输出excel用
	public ArrayList<String> getInfo(String[] list){
		JSONObject jexamieeInfo = JSONObject.fromObject(this.toString());
		ArrayList<String> array = new ArrayList<String>();
		for(int i=0;i<list.length;i++){
			array.add(jexamieeInfo.getString(list[i]));
		}
		return array;
	}
	
	//输入excel用
	public void setInfo(Map<String,String> userInfo){
		if(userInfo.containsKey("userId")){
			this.setUserId(userInfo.get("userId"));
		}
		if(userInfo.containsKey("id")){
			this.setIdCardNum(userInfo.get("id"));
		}
		if(userInfo.containsKey("gender")){
			this.setGender(userInfo.get("gender"));
		}
		if(userInfo.containsKey("admitId")){
			this.setAdmitId(userInfo.get("admitId"));
		}
		if(userInfo.containsKey("eeid")){
			this.setEeId(userInfo.get("eeid"));
		}
		if(userInfo.containsKey("name")){
			this.setUserName(userInfo.get("name"));
		}
		if(userInfo.containsKey("userPhoto")){
			this.setUserPhoto(userInfo.get("userPhoto")+basePath);
		}
		if(userInfo.containsKey("userDescribe")){
			this.setUserDescribe(userInfo.get("userDescribe"));
		}
		if(userInfo.containsKey("phoneNo")){
			this.setPhoneNum(userInfo.get("phoneNo"));
		}
		if(userInfo.containsKey("email")){
			this.setMail(userInfo.get("email"));
		}
		if(userInfo.containsKey("userSubType")){
			this.setSubject(userInfo.get("userSubType"));
		}
		if(userInfo.containsKey("psd")){
			this.setPsd(userInfo.get("psd"));
		}
		if(userInfo.containsKey("state")){
			this.setState(Integer.parseInt(userInfo.get("state")));
		}
		if(userInfo.containsKey("birthday")){
			this.setBirthday(userInfo.get("birthday"));
		}
		if(userInfo.containsKey("policy")){
			this.setPolicy(userInfo.get("policy"));
		}
		if(userInfo.containsKey("nation")){
			this.setNation(userInfo.get("nation"));
		}
		
	}

}